<!--
Author: Quan Van Sinh
Email : sinhvnb@vietnambiz.com
Mobile: 0972405165
-->
<?php include ADMIN_INCLUDE_DIR."/header.php";?>
<script type="text/javascript" language="javascript">
    function delNews(params,text){
        confirm_get("Do you want to delete "+text+"?",'<?php echo ADMIN_URL;?>'+params);
    }

    function multiNewsAction(action){
        objForm = $("#formNewsView");
        switch (action) {
            case 'delete':
                $("#formNewsViewAction").val('delete');
                confirm_post("Do you want to delete selected news?",'formNewsView');
                break;
            case 'setStatusYes':
                $("#formNewsViewAction").val('setStatusYes');
                objForm.submit();
                break;
            case 'setStatusPending':
                $("#formNewsViewAction").val('setStatusPending');
                objForm.submit();
                break;
            case 'setStatusNo':
                $("#formNewsViewAction").val('setStatusNo');
                objForm.submit();
                break;
        }

    }
</script>
<div class="container_l">
    <div class="title_user"><img src="images/icon4.gif" />Danh sách Đối tác</div>
    <div class="table_user">

        <?php
        show_error();
        show_success();
        ?>
        <div class="spacer1"><span></span></div>
        
        <div class="spacer1"><span></span></div>
        <form id="formNewsView" method="post" action="">
            <div class="table_user_in">
                <div class="boxtitle">
                    <div class="d_input">
                        <input type="checkbox" name="checkall" id="checkall" value="" />
                        <input type="hidden" id="formNewsViewAction" name="formNewsViewAction" value=""/>
                        <input type="hidden" id="action" name="action" value="multiAction"/>
                    </div>
                    <div class="d_title">Đối tác</div>
                    <div class="d_datetime">Ngày tạo</div>
                    <div class="d_datetime" style="width:12%">Trạng thái</div>
                    <div class="d_setting">Thao tác</div>
                </div>
                <?php
                $rsNews = listAllNews();
                if($db->num_rows($rsNews['rs'])) {
                    while($rs=$db->fetch_array($rsNews['rs'])) {
                        ?>
                <div class="lineuser">
                    <div class="d_input2"><input type="checkbox" name="arr_news_id[]" class="check" value="<?php echo $rs['id'];?>" /></div>
                    <div class="d_title2"><font class="textbody"><a href="javascript: void(0);" title="<?php echo htmlentities($rs['realname'], ENT_COMPAT, 'UTF-8');?>"><?php if($rs['title']!=''){echo $rs['title'];}else{echo $rs['realname'];}?></a></font></div>
                    <div class="d_datetime2"><font class="textbody"><?php echo date('d/m/Y',strtotime($rs['create_date']));?></font></div>
                    
                    <div class="d_datetime2" style="width:12%">
                        <?php if($rs['status']=='yes'){echo 'hiện';}else{echo 'ẩn';}?>
                    </div>
                    <div class="d_setting2">
                        <a href="<?php echo get_string_url(array('action','id'));?>&action=edit&id=<?php echo $rs['id'];?>"><img src="images/edit.gif" alt="Edit" title="Edit" /></a>
                        <a href="javascript: delNews('?module=partner&action=del&page=<?php echo $rsNews['page'];?>&id=<?php echo $rs['id'];?>','<?php echo htmlentities($rs['realname'], ENT_COMPAT, 'UTF-8');?>')"><img src="images/delete.gif" alt="Delete" title="Delete" /></a>
                    </div>
                </div>
                    <?php
                    }
                    ?>
                <div class="boxbutton">
                    <input type="button" onclick="javascript: multiNewsAction('delete');" value="Delete" class="button" />
                </div>
                    <?php paging($rsNews['page'], $rsNews['totalPages'], get_string_url());?>

                <?php }?>
            </div>
        </form>
    </div>
</div>

<?php
include "inc/right.php";
include ADMIN_INCLUDE_DIR."/footer.php";
?>